var a = getApp();

Page({
    data: {
        page: 1
    },
    onLoad: function(a) {
        a.id && this.setData({
            id: a.id
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page >= this.data.last_page ? wx.showToast({
            title: "没有更多",
            icon: "none",
            duration: 1e3
        }) : (this.setData({
            page: this.data.page + 1
        }), this.getMore());
    },
    onShareAppMessage: function() {},
    getdata: function() {
        var t = a.getNetAddresss("plugin.energy-cabin.frontend.dealer-terminal.use-log"), e = this;
        a._getNetWork({
            url: t,
            data: {
                equipment_id: e.data.id,
                page: e.data.page
            },
            success: function(a) {
                var t = a.data;
                1 == t.result && (console.log(t), e.setData({
                    datas: t.data.data,
                    current_page: t.data.current_page,
                    last_page: t.data.last_page
                }));
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getMore: function() {
        var t = a.getNetAddresss("plugin.energy-cabin.frontend.dealer-terminal.use-log"), e = this;
        a._getNetWork({
            url: t,
            data: {
                equipment_id: e.data.id,
                page: e.data.page
            },
            success: function(a) {
                var t = a.data;
                1 == t.result && (console.log(t), e.setData({
                    datas: e.data.datas.concat(t.data.data),
                    current_page: t.data.current_page,
                    last_page: t.data.last_page
                }));
            },
            fail: function(a) {
                console.log(a);
            }
        });
    }
});